// pages/payment/payment.js
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		data: '',
		http: getApp().globalData.map
	},

	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad: function(options) {
		wx.getStorage({
			key: 'uid',
			success: (e) => {
				wx.request({
					url: getApp().globalData.http + 'action=getOrderDetail&oid=' + options.id + '&uid=' + e.data.uid + '&L=' +
						options.L,
					success: (res) => {
						console.log(res)
						this.setData({
							data: res.data.data,
							uid:e.data.uid
						})
					}
				})
			}
		})
	},
	wl() {
		wx.showToast({
			title: '物流单号：' + this.data.data.express_code + '已复制',
		})
		wx.setClipboardData({
			data: this.data.data.express_code,
			success: function(res) {
				wx.getClipboardData({
					success: function(res) {
						console.log(res.data)
					}
				})
			}
		})
	},
	dele(){
		wx.showModal({
			title:'您确定要删除订单吗？',
			success: (e) => {
				console.log(e)
				if(e.confirm){
					wx.request({
						url:getApp().globalData.http+'action=deleteOrder&oid='+this.data.data.order.ord_id+'&userID='+this.data.uid,
						success: (e) => {
							console.log(e)
							wx.navigateBack({
								delta:1
							})
						}
					})
				}
			}
		})
	}
})
